package com.liuyc.lib.tools.ext

import android.app.Activity
import android.content.Context

/**
 *
 *
 * 刘隽
 */


inline fun <reified  T> Activity.getBundleValue(key: String): T?{

    val extras = intent.extras

    var value: T?

    if (extras == null || !extras.containsKey(key)) {
        value = null
    } else {
        val kClass = T::class
        var result = when (kClass) {
            String::class -> {
                extras.getString(key) ?: null
            }
            else -> throw IllegalStateException("暂时仅支持 ")
        }

        value = result as? T
    }
    return value
}


inline fun Context.startActivity(vararg pairs: Pair<String, String>){

}


